package lab5Source;

public class S_RemoveLadyBirdCommand extends AbstractCommand {	
	private LadyBird lady;
	private Object memento;
	
	public S_RemoveLadyBirdCommand(LadyBird lady) {
		this.lady = lady;
	}

	@Override
	public void Execute() {
		// create memento
		this.memento = this.lady.S_createMemento();		
		// remove lady
		LadyBirdManager.instance().removeLadyBird(this.lady);
	}

	@Override
	public void Unexecute() {		
		// create new lady
		this.lady = LadyBirdManager.instance().createLadyBird();
		// restore old lady's settings
		this.lady.S_setMemento(this.memento);
	}

}
